package cn.northsea.controller;

import cn.northsea.common.Result;
import cn.northsea.entity.Seek;
import cn.northsea.entity.SeekUser;
import cn.northsea.service.SeekService;
import cn.northsea.service.UserService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Date;

import static cn.northsea.common.enums.ResultCodeEnum.*;

@RequestMapping("/login")
@CrossOrigin
@RestController
public class LoginController {
    @Autowired
    UserService userService;
    @PostMapping("/login")
    public Result login(@RequestBody SeekUser user, HttpServletResponse response){
        return userService.psdLogin(user,response);
    }

}
